using UnityEngine;

namespace Crosstales.Common.Util
{
    // [Assembly-CSharp-firstpass.dll].Crosstales.Common.Util.CTWebClient
    public class CTWebClient : WebClient
    {
        // Fields
        private int _Timeout_k__BackingField;
        private int _ConnectionLimit_k__BackingField;
        
        // Properties
        public int Timeout { get; set; }
        public int ConnectionLimit { get; set; }
        
        // Methods
        public int get_Timeout()
        {
            return (int)this._Timeout_k__BackingField;
        }
        public void set_Timeout(int value)
        {
            this._Timeout_k__BackingField = value;
        }
        public int get_ConnectionLimit()
        {
            return (int)this._ConnectionLimit_k__BackingField;
        }
        public void set_ConnectionLimit(int value)
        {
            this._ConnectionLimit_k__BackingField = value;
        }
        public CTWebClient()
        {
        
        }
        public CTWebClient(int timeout, int connectionLimit = 20)
        {
            this._Timeout_k__BackingField = timeout;
            this._ConnectionLimit_k__BackingField = connectionLimit;
        }
        public System.Net.WebRequest CTGetWebRequest(string uri)
        {
            536895261 = new System.Uri(uriString:  uri);
            goto typeof(Crosstales.Common.Util.CTWebClient).__il2cppRuntimeField_1E8;
        }
        protected override System.Net.WebRequest GetWebRequest(System.Uri uri)
        {
            System.Uri val_7;
            var val_8;
            val_7 = uri;
            System.Net.WebRequest val_1 = this.GetWebRequest(address:  val_7);
            val_8 = val_1;
            if(val_1 == null)
            {
                    return (System.Net.WebRequest)val_8;
            }
            
            if((System.Type.op_Equality(left:  val_8.GetType(), right:  System.Type.GetTypeFromHandle(handle:  new System.RuntimeTypeHandle() {value = 1073757933}))) == false)
            {
                    return (System.Net.WebRequest)val_8;
            }
            
            System.Net.WebRequest val_5 = this.GetWebRequest(address:  val_7);
            if(val_5 == null)
            {
                    return (System.Net.WebRequest)val_8;
            }
            
            val_7 = val_5;
            val_7.ServicePoint.ConnectionLimit = this._ConnectionLimit_k__BackingField;
            val_8 = val_7;
            return (System.Net.WebRequest)val_8;
        }
    
    }

}
